//${enName}的请求封装
import request from "@/utils/http.ts"
interface ${enName} data {
/**
* 搜索字段
*/
private List<${stringName}> searchList;//搜索字段集合
private List<${query_name}> queryList;//查询条件集合
searchName:string;//搜索值

<#if columns??>
    <#list dtos as column>

        <#if column.type='VARCHAR'||column.type='TEXT'||column.type='CHAR'>
            ${column.propertyName?uncap_first}:string;
        </#if>
        <#if column.type='INT'>
            ${column.propertyName?uncap_first}:number;
        </#if>
        <#if column.type='DATETIME'>
            ${column.propertyName?uncap_first}:Dayjs | null;
        </#if>
        <#if column.type='BIGINT'>

            /**
            * ${column.remark}
            */
            private Long ${column.propertyName?uncap_first};

        </#if>
        <#if column.type='DOUBLE'>

            /**
            * ${column.remark}
            */
            private Double ${column.propertyName?uncap_first};

        </#if>
        <#if column.type='BIT'>

            /**
            * ${column.remark}
            */
            private Boolean ${column.propertyName?uncap_first};

        </#if>
    </#list>
</#if>
}





//1.新增${enName}
export const create${enName}API = (data: any) => {
    return request({
        url: '${enName}/create',
        method: 'post',
        data: data
    })
}

//2.查询By${enName}Id
export const query${enName}By${enName}IdAPI = (data: any) => {
    return request({
        url: '${enName}/queryBy${enName}Id',
        method: 'post',
        data: data
    })
}

//3.查询By其他字段
export const query${enName}ByOtherAPI = (data: any) => {
    return request({
        url: '${enName}/queryByOther',
        method: 'post',
        data: data
    })
}

//4.查询所有
export const query${enName}AllAPI = (data: any) => {
    return request({
        url: '${enName}/queryAll',
        method: 'post',
        data: data
    })
}

//5.删除By${enName}Id
export const delete${enName}By${enName}IdAPI = (data: any) => {
    return request({
        url: '${enName}/deleteBy${enName}Id',
        method: 'post',
        data: data
    })
}

//6.修改By${enName}Id
export const update${enName}By${enName}IdAPI = (data: any) => {
    return request({
        url: '${enName}/updateBy${enName}Id',
        method: 'post',
        data: data
    })
}

//7.分页查询${enName}
export const query${enName}ByPageAPI = (data: any) => {
    return request({
        url: '${enName}/query${enName}ByPage',
        method: 'post',
        data: data
    })
}